package c.j.a.c.y.a;

import android.app.Activity;
import java.util.Locale;

/* compiled from: ApkInstallGuideDialog */
public class f implements Runnable {
    public final /* synthetic */ g a;

    public f(g gVar) {
        this.a = gVar;
    }

    public void run() {
        g gVar = this.a;
        if (gVar.n != null) {
            Activity activity = (Activity) gVar.a.get();
            if (activity == null || !activity.isFinishing()) {
                gVar = this.a;
                int i = gVar.m - 1;
                gVar.m = i;
                if (i > 0) {
                    gVar.f.setText(String.format(Locale.getDefault(), "立即安装 %d 秒", new Object[]{Integer.valueOf(this.a.m)}));
                    gVar = this.a;
                    gVar.l.postDelayed(new f(gVar), 1000);
                } else {
                    gVar.a();
                }
            }
        }
    }
}
